package com.example.amap.service.map

import android.content.Context
import androidx.lifecycle.LifecycleOwner
import com.alibaba.android.arouter.facade.template.IProvider
import com.example.amap.map.IMapView
import com.example.amap.service.lifecycle.ILifecycleService

/**
 * 地图服务
 */
interface IMapService : ILifecycleService, IProvider {

    override fun init(context: Context?) {
    }

    /**
     * SDK初始化
     */
    fun sdkInit(context: Context?) {}

    /**
     * 创建地图视图
     */
    fun createMapView(context: Context): IMapView? {
        if (context is LifecycleOwner) {
            context.lifecycle.addObserver(this)
        }
        return null
    }
}